import { defineStore } from 'pinia'
import {reqGetYanXuanIndexData,reqCategoryData} from '../api/api1'
export const useCounterStore = defineStore('counter', {
  state: () => {
    return { 
      count: 999 ,
      // yanxuanIndexData:{},
      categoryData:{}
    }
  },
  actions: {
    increment() {
      this.count++
    },
    // async getYanXuanIndexData(){
    //   const res = await reqGetYanXuanIndexData()
    //   console.log('pinia',res.data)
    //   this.yanxuanIndexData = res.data
    // },
    async getCategoryData(){
      const res = await reqCategoryData()
      console.log('meiyouwenti',res)
      this.categoryData=res
    }
  },
})